/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package backingBean;

import entities.Members;
import entities.Membership;
import javaServices.MemberManager;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import javax.faces.context.FacesContext;

/**
 *
 * @author michael
 */
@ManagedBean(name = "membership")
@RequestScoped
public class MembershipMB {

    private Membership membership;
    private Members member;
    /**
     * Creates a new instance of MembershipMB
     */
    public MembershipMB() {
        FacesContext context = FacesContext.getCurrentInstance();
               
        member = (Members)context.getExternalContext().getSessionMap().get("member");
    }
    
    public String NewMembership(int typeOfMembership){
        
        if(typeOfMembership == 1){
            
        }
        else if(typeOfMembership == 2){
            
        }
        else{
            
        }
        
        
        return null;
    }
    
    public String finishRegister(){       
        MemberManager.updateUser(member);
        
        return "profile";
    }
}
